﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyLogPC.Model
{
    [SqlSugar.SugarTable("Position")]
    public class AxisPositionAddressModel: BaseAddressModel
    {
        
    }
    [SqlSugar.SugarTable("IO")]
    public class IOAddressModel:BaseAddressModel
    {

    }
    public class EnergyAddressModel: BaseAddressModel
    {

    }
    [SqlSugar.SugarTable("Alarm")]
    public class AlarmAddressModel : BaseAddressModel
    {
    }
    public class AutoFlowAddressModel : BaseAddressModel
    {
    }
    public class BaseAddressModel
    {
        //自增id
        [SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true,ColumnName ="ID")]

        public int Id { get; set; } = 0;

        public string Address { get; set; } = string.Empty;
        public string Name { get; set; } = string.Empty;
        public ushort Length { get; set; } = 0;

        
        public BaseAddressModel()
        {
        }
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.AppendLine($"Id: {Id}");
            sb.AppendLine($"Address: {Address}");
            sb.AppendLine($"Name: {Name}");
            return sb.ToString();
        }
    }
}
